public class dome1 {
    public static void main(String[] args) {
        lqy lqy = new lqy() ;
        nqr nqr = new nqr() ;
        zwj zwj = new zwj() ;
        Room[] rooms = {lqy,nqr,zwj} ;
        for (Room room: rooms) {
            room.print();
        }
    }


    public static void pr(Room room){
        room.print();
    }
}

class Room{
    public void print(){
        System.out.println("101宿舍");
    }
}
class lqy extends Room{
    public void print(){
        System.out.println("雷其扬");
    }
}
class nqr extends Room{
    @Override
    public void print() {
        System.out.println("年轻人");
    }
}
class zwj extends Room{
    @Override
    public void print() {
        System.out.println("朱文杰");
    }
}


